package com.study.test;


import com.study.bean.aop.MathCalculator;
import com.study.config.MainConfigOfAop;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author wuwenbo
 * @date 2020/3/27 - 17:21
 */
public class IOCTest_AOP {
    @Test
    public void test01() {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(MainConfigOfAop.class);
//          *我们不要自己去创建对象 进行调用，这样是没有效果的*
//        MathCalculator mathCalculator = new MathCalculator();
//        mathCalculator.div(1, 1);
        MathCalculator mathCalculator = applicationContext.getBean(MathCalculator.class);
        mathCalculator.div(1, 1);

        System.out.println("================================================");
        mathCalculator.div(1, 0);
    }

}

